package com.geek.spring.bean;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @program java-spring
 * @description: java config 装配
 * @author: chanzhugang
 * @create: 2021/04/18 00:22
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = CDPlayerConfig2.class)
public class ConfigBeanMain {

    @Autowired
    private CDPlayer cdPlayer;

    @Autowired
    private CompactDisc compactDisc;

    @Test
    public void testPlay() {
        String str = "java config playing ";
        cdPlayer.play(str);
        compactDisc.play(str);
    }
}